<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <script src="./vue.js"></script>
    <script>
      const age = 20;
      const vm = new Vue({
        /*
          挂载模板 #app.outerHTML=template 解析模板
        */
        el: "#app",
        /*
          模板
          - 模板中的this可以省略不写
          - 输出对象属性，调用对象方法 
        */
        template: "<div>{{username}} <hr> {{say()}} </div>",
        // data 配置项
        data: {
          username: "jack",
        },
        // methods 配置项
        methods: {
          say() {
            return this.username;
          },
        },
      });

      setTimeout(() => {
        console.log(vm.$options.template);
      }, 3000);
    </script>
  </body>
</html>
